home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_10503_000069.msg < prev    next >
Encoding:
Text File  |  1994-11-27  |  2.5 KB  |  50 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb.informatik.uni-kl.de!feck
  3. From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
  4. Subject: Re: BOOPSI Class Names
  5. Message-ID: <1994May9.143931@informatik.uni-kl.de>
  6. Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
  7. Nntp-Posting-Host: uklira.informatik.uni-kl.de
  8. Organization: University of Kaiserslautern, Germany
  9. References: <2pu92s$mh7@lovelady.cs.utexas.edu> <CpFuCu.4qx@news.ci.ua.pt> <2qh5nu$mhs@priddy.cs.utexas.edu> <1994May8.165619@informatik.uni-kl.de> <2qjff0$r3m@priddy.cs.utexas.edu>
  10. Date: Mon, 9 May 1994 12:39:31 GMT
  11. Lines: 37
  12.  
  13. In article <2qjff0$r3m@priddy.cs.utexas.edu>, mthomas@cs.utexas.edu (Mark A. Thomas) writes:
  14. > In article <1994May8.165619@informatik.uni-kl.de>,
  15. > Christoph Feck IRZ <feck@informatik.uni-kl.de> wrote:
  16. > >The solution is simple:  Make your library have _one_ LVO (let's
  17. > >call it GetClass() here).
  18. > Yes, this is a nice solution...  The only reason that I can come up
  19. > with for this not being the best solution is that it will take 3
  20. > steps to get a gadget (OpenClass(), GetClass(), and CreateObject()),
  21. > as opposed to 2 (OpenClass(), CreateObject()).  However it does have
  22. > the advantage of not having to wait for Commodore to approve of a
  23. > public class name.  I guess I'll use this now, and when I get
  24. > approval I'll let you do it either way.  Thanks.
  25.  
  26. There is another reason:  Speed!  Say you want to create 100
  27. button objects in your window, the OS would search 100 times
  28. the public class list.  When more and more people add classes
  29. to this list, the startup time of your program increases
  30. proportional to O(n*m).  But if you already have a class pointer
  31. (_AND_ it is guarantueed to stay valid as long as the library
  32. is openend), you can just do a simple CoerceMethod call:
  33.  
  34.   newobj = CoerceMethod(class, class, OM_NEW, attributes);
  35.  
  36. This directly jumps into the class dispatcher.  The only
  37. reason the Intuition call NewObjectA exists, is because
  38. of locking the class to prevent it from unloading while
  39. the object is being created (semaphores et al.).
  40.  
  41. > Yes, certainly.  My goal was to always follow the Commodore
  42. > standard, that's why I'm a bit hesitant about GetClass().
  43.  
  44. Actually, datatype classes also have this LVO at offset -30.
  45. That's where I got the idea :)
  46.  
  47. 3k// Christoph Feck, TowerSystems - BOOPSI Class Development
  48. \X/ Amiga - Intuition inside.
  49.